/* 侧边栏样式 */
.sidebar {
  position: fixed;
  top: 60px;
  right: -280px; /* 默认隐藏 */
  width: 280px;
  height: calc(100vh - 60px);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar.open {
  right: 0;
}

.sidebar-toggle {
  position: fixed;
  top: 95px; /* 调整高度，避免被用户信息区域遮挡 */
  right: 0;
  width: 32px;
  height: 48px;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 8px 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.1);
  z-index: 41;
  cursor: grab; /* 指示可拖动 */
}

.sidebar-toggle:focus {
  outline: none;
}

.sidebar-toggle i {
  transition: transform 0.3s ease;
}

.sidebar-toggle.open i {
  transform: rotate(180deg);
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h3 {
  font-size: 1rem;
  font-weight: bold;
  margin: 0;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section-title {
  font-size: 0.875rem;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.sidebar-section-title i {
  margin-right: 0.5rem;
}

/* 资源卡片 - 侧边栏样式 */
.sidebar-resource {
  background-color: rgba(0, 0, 0, 0.03);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-resource-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.sidebar-resource-info {
  flex: 1;
}

.sidebar-resource-name {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.6);
}

.sidebar-resource-amount {
  font-size: 1rem;
  font-weight: bold;
}

.sidebar-resource-rate {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
}

/* 快速操作按钮 */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.03);
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
  transition: all 0.2s;
}

.quick-action-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.quick-action-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  color: var(--color-primary);
}

.quick-action-text {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.8);
}

/* 主内容区域调整 */
@media (min-width: 768px) {
  .main-content {
    transition: padding-right 0.3s ease;
  }
  
  .main-content.sidebar-open {
    padding-right: 280px;
  }
}

/* 移动端适配 */
@media (max-width: 767px) {
  .sidebar {
    width: 85%;
    right: -85%;
  }
  
  .sidebar-toggle {
    top: 95px; /* 与桌面版保持一致，避免被用户信息区域遮挡 */
  }
}

/* 侧边栏内事件卡片 */
.sidebar-event {
  background-color: rgba(255, 152, 0, 0.05);
  border-left: 3px solid var(--color-warning);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-event-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.sidebar-event-desc {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.6);
  margin-bottom: 0.5rem;
}

.sidebar-event-action {
  display: block;
  width: 100%;
  padding: 0.5rem;
  background-color: var(--color-warning);
  color: white;
  border: none;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  text-align: center;
  cursor: pointer;
}
